from django.db import models

# Create your models here.

class Book(models.Model):
    name = models.CharField(max_length=100,null=False)
    author = models.CharField(max_length=100,null=False)
    price = models.FloatField(default=0)
    class Meta:
        ordering = ['price']

    def __str__(self):
        #return "<book:(name:%s,author:%s,price:%s)>" % (self.name,self.author,self.price)
        return "<book:({name},{author},{price})>".format(name=self.name,author=self.author,price=self.price)


